//
//  CJSTravelDetailView.m
//  GoTraveling
//
//  Created by 陈金山 on 15/12/26.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import "CJSTravelDetailView.h"
#import "CJSWaypoints.h"
#import "UIImageView+WebCache.h"

@interface CJSTravelDetailView ()

@property (nonatomic, retain) UIImageView *imageView;

@end

@implementation CJSTravelDetailView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor blackColor];
        [self createSubView];
    }
    return self;
}

- (void)createSubView {
    
    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 300)];
    self.imageView.center = self.center;
    self.imageView.contentMode = UIViewContentModeScaleAspectFill;
    self.imageView.layer.masksToBounds = YES;
    [self addSubview:self.imageView];
}

- (void)setPhoto:(NSString *)photo {
    
    _photo = photo;
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:self.photo]];
    
}



@end
